package com.qf.mapper;

import com.qf.pojo.entity.Student;
import com.qf.pojo.vo.StudentVO;
import org.apache.ibatis.annotations.*;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface StudentMapper {


    Student findStudentById(int id);

    @Select("select * from stu")
    List<Student> findAllStudent();

    List<Student> findByKeyword(HashMap<String, Object> map);

    @Insert("insert into stu(sname,age,sex,score,birthday) values(#{sname},#{age},#{sex},#{score},#{birthday})")
    void insert(Student student);

    @Update("update stu set sname=#{sname},age=#{age},sex=#{sex},score=#{score},birthday=#{birthday} where id=#{id}")
    void updateStudent(Student student);

    @Delete("delete from stu where id=#{id}")
    void deleteStudent(int id);

    void batchDeleteStudent(List<Integer> ids);

    List<StudentVO> findAllStudentAndClassroom();

    StudentVO findStudentAndAllSubjectByStuid(int sid);

    StudentVO findStudentAndAllSubjectAndTeacherByStuid(int sid);
}
